package org.happen.android.base;

import org.liushui.mycommons.android.log.McLog;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public abstract class BaseV4Fragment extends Fragment implements IV4Fragment
{

	protected Context context;
	protected View contentView;

	public void onChange()
	{
		McLog.md(this, "onChange");
	}

	protected abstract int getLayoutId();

	protected abstract void init(Bundle savedInstanceState);

	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
	{
		McLog.md(this, "onCreateView");
		context = getActivity();
		contentView = View.inflate(context, getLayoutId(), null);
		init(savedInstanceState);
		return contentView;
	}

	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		McLog.md(this, "onCreate");
	}

	public void onStart()
	{
		super.onStart();
		McLog.md(this, "onStart");
	}

	public void onResume()
	{
		super.onResume();
		McLog.md(this, "onResume");
	}

	public void onPause()
	{
		super.onPause();
		McLog.md(this, "onPause");
	}

	public void onStop()
	{
		super.onStop();
		McLog.md(this, "onStop");
	}

	public void onDestroy()
	{
		super.onDestroy();
		McLog.md(this, "onDestroy");
	}
}